﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using entity;
using System.Data;

namespace DAL
{
    /// <summary>
    ///  板块关注股票
    /// </summary>
    public class ConcernedStockDAL
    {
        public List<ConcernedStock> GetAllData()
        {
            string sql = "select * from BLOCK_COMMEND_STOCK";
            var tb= SqlHelper.ExecuteGetTable(DBManager.qgqp, System.Data.CommandType.Text, sql, null);
            List<ConcernedStock> lst = new List<ConcernedStock>();
            for (int i = 0; i < tb.Rows.Count; i++)
            {
                DataRow row=tb.Rows[i];
                ConcernedStock c = new ConcernedStock();
                c.BKID = Tools.GetString(row["block_id"]);
                c.StockId = Tools.GetString(row["stock_id"]);
                c.Reason = Tools.GetString(row["reason"]);
                c.CTime = Tools.GetDateTime(row["date"]);
                lst.Add(c);
            }
            return lst;
        }
    }
}